package bean;

import com.demo.service.FrService;
import mapper.FrTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Component;

import javax.faces.context.FacesContext;

/**
 * User: yuebo
 * Date: 13-9-8
 * Time: 下午7:53
 */
@Component
@Scope("request")
public class BattleBean {
    private FrTask task;
    private int id;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Autowired
    private FrService service;

    public void setService(FrService service) {
        this.service = service;
    }

    public FrTask getTask() {
        return task;
    }

    public void setTask(FrTask task) {
        this.task = task;
    }

    public void loadTask(String id){
        this.task=service.findTaskById(Integer.parseInt(id));
    }

}
